Skip to content

Conversation

@eksperimental
Copy link
Contributor

I was experiencing this error on VS Code.

[info]   Message: ** (FunctionClauseError) no function clause matching in XPExpert.Protocol.Conversions.to_elixir/2
    (xp_expert 0.1.0-399b2a0) lib/expert/protocol/conversions.ex:22: XPExpert.Protocol.Conversions.to_elixir(%XPGenLSP.Structures.Range{end: %XPGenLSP.Structures.Position{character: 0, line: 0}, start: %XPGenLSP.Structures.Position{character: 0, line: 0}}, nil)
    (xp_forge 0.1.0-399b2a0) lib/forge/protocol/convertible.ex:52: anonymous fn/4 in XPForge.Protocol.Convertible.Helpers.apply/3
    (elixir 1.17.3) lib/enum.ex:4858: Enumerable.List.reduce/3
    (elixir 1.17.3) lib/enum.ex:2585: Enum.reduce_while/3
    (xp_forge 0.1.0-399b2a0) lib/forge/protocol/convertible.ex:182: XPForge.Protocol.Convertible.Any.to_native/2
    (xp_expert 0.1.0-399b2a0) lib/expert/protocol/convert.ex:26: XPExpert.Protocol.Convert.to_native/1
    (xp_expert 0.1.0-399b2a0) lib/expert.ex:119: XPExpert.handle_request/2
    (xp_gen_lsp 0.11.2) lib/gen_lsp.ex:369: anonymous fn/2 in XPGenLSP.loop/3

  Code: -32603 

@Terbium-135
Copy link

Where this call comes from? VSCode?
And is it fixing the problem? Just a bit scared here.

This PR will fix #274 as well.

@eksperimental eksperimental changed the title fix: do not crash when Expert.Protocol.Conversions.to_elixir/2 receives nil as document [WIP] fix: do not crash when Expert.Protocol.Conversions.to_elixir/2 receives nil as document Jan 16, 2026
@mhanberg
Copy link
Member

mhanberg commented Jan 16, 2026

@eksperimental just mark it as a draft if its still in progress

@eksperimental eksperimental marked this pull request as draft January 16, 2026 16:19
@eksperimental eksperimental changed the title [WIP] fix: do not crash when Expert.Protocol.Conversions.to_elixir/2 receives nil as document fix: do not crash when Expert.Protocol.Conversions.to_elixir/2 receives nil as document Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants